<?php if( $tpl['_header'] ){ include($_CFG['DIR_ADMIN_TPL'].'header.html'); }?>


<?php if( $tpl['_body'] == 'list' ){ ?>

    <?php if( $tpl['_bodysub'] != 'query' ){?>
    <div class="listtable-div" id="listtable-privilege" onmouseover="ListTable.init(this.id,'modules/kernel/privilege.php','?act=list');">
        <form class="listtable-search" onsubmit="listtable_search(this);return false;">
            <table class="listtable-table">
            <tr>
                <td width="30"><i class="icon"></i></td>
                <td width="45"><h1>模块：</h1></td>
                <td><?php echo $tpl['formc_module']; ?></td>
                <td style="padding-left:15px;"><input type="submit" value="搜 索" class="submit"/><input type="button" class="flush" onmouseover="combobox_mouseover(this)" onclick="ListTable.resetList()" title="初始化搜索"/></td>
            </tr>
            </table>
        </form>

        <div class="listtable-data">
    <?php }?>       

            <table class="listtable-table" onmouseover="TableAct.moveHiLight(this);TableAct.choiceHiLight(this);">
            <tr>
                <th width="5%">标识</th>
                <th width="20%">权限名</th>
                <th width="16%">模块</th>
                <th width="14%">模块操作码</th>
                <th width="12%">模块操作名</th>
                <th width="12%">排序</th>
                <th width="21%">操作</th>
            </tr>
            <?php if( !empty($tpl['list']['data']) ){ foreach( $tpl['list']['data'] AS $r ){?>
            <tr align="center">
                <td><?php echo $r['privilege_id']; ?></td>
                <td><?php e($r['name'],'html'); ?></td>
                <td><?php e($r['module_name'],'html'); ?></td>
                <td><?php e($r['module_act_code'],'html'); ?></td>
                <td><?php e($r['module_act_name'],'html'); ?></td>
                <td><?php echo $r['order']; ?></td>
                <td class="action"><?php echo $r['acts']; ?></td>
            </tr>
            <?php }}else{?>
            <tr><td colspan="7"><div class="tips-div"><span>无数据</span></div></td></tr>
            <?php }?>
            </table>

            <div class="listtable-footer">
                <?php if( !empty($tpl['list']['data']) ){?>
                <div class="pager"><?php echo $tpl['list']['pager']['html']; ?></div>
                <?php }?>
            </div>

    <?php if( $tpl['_bodysub'] != 'query' ){?>
        </div>
    </div>
    <?php }?>


<?php }elseif( $tpl['_body'] == 'add' || $tpl['_body'] == 'edit' ){ ?>
    <form id="wfm-privilege-fill" onkeydown="deal_wfm_keyboard(event,this);">
        <div class="form-div" style="border-top:0;border-bottom:0;">
            <table class="form-table">
            <tr>
                <td width="75"><h1>权限名称：</h1></td>
                <td><input type="text" name="name" class="fillbox" value="<?php e($tpl['privilege']['name'],'formc'); ?>"/></td>
            </tr>
            <tr>
                <td><h1>所属模块：</h1></td>
                <td><?php echo $tpl['formc_module']; ?></td>
            </tr>
            <tr>
                <td><h1>操作名称：</h1></td>
                <td><input type="text" name="module_act_name" class="fillbox" value="<?php e($tpl['privilege']['module_act_name'],'formc'); ?>"/></td>
            </tr>
            <tr>
                <td><h1>操作代码：</h1></td>
                <td><input type="text" name="module_act_code" class="fillbox" value="<?php e($tpl['privilege']['module_act_code'],'formc'); ?>"/></td>
            </tr>
            <tr>
                <td><h1>排序：</h1></td>
                <td><input type="text" class="textbox" name="order" value="<?php e($tpl['privilege']['order'],'default','1'); ?>"/></td>
            </tr>
            </table>
        </div>

        <input type="hidden" name="privilege_id" value="<?php echo $tpl['privilege']['privilege_id']; ?>"/>
    </form>


<?php } ?>